package br.net.woodstock.tickettoride.client.utils;

import br.net.woodstock.rockframework.text.impl.RandomGenerator;
import br.net.woodstock.rockframework.text.impl.RandomGenerator.RandomPattern;

public abstract class StringUtils {

	public static String getRandomString(final int size) {
		RandomGenerator generator = new RandomGenerator(size, RandomPattern.LETTER_OR_DIGIT);
		return generator.generate();
	}

	public static String toString(final byte[] bytes) {
		return new String(bytes, CodecUtils.CHARSET);
	}

	public static byte[] toByteArray(final String str) {
		return str.getBytes(CodecUtils.CHARSET);
	}

}
